package com.liujun.spring4.demo.aop.application.property.outer;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import sun.misc.Contended;

/**
 * 在基于注解的xml文件中使用java配制方式引用属性
 *
 * @author liujun
 * @version 0.0.1
 * @date 2018/09/06
 */
@Component
public class MyDataSource {

  @Value("${driverClassname}")
  private String driverClass;

  @Value("${url}")
  private String url;

  @Value("${userName}")
  private String userName;

  @Value("${password}")
  private String passWord;

  @Override
  public String toString() {
    final StringBuilder sb = new StringBuilder("MyDataSource{");
    sb.append("driverClass='").append(driverClass).append('\'');
    sb.append(", url='").append(url).append('\'');
    sb.append(", userName='").append(userName).append('\'');
    sb.append(", passWord='").append(passWord).append('\'');
    sb.append('}');
    return sb.toString();
  }
}
